package com.legend.ds.config;



import lombok.extern.slf4j.Slf4j;
import org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource;

/**
 * @Auther: tangwei
 * @Date: 2021/7/12 下午3:24
 * @Description: 类描述信息
 */
@Slf4j
public class LanzhenDynamicDataSource extends AbstractRoutingDataSource {
    @Override
    protected Object determineCurrentLookupKey() {
        String datasource = LanzhenDynamicDataSourceContextHolder.getDataSourceType();
        log.info("使用数据源 {}", datasource);
        return datasource;
    }
}


